home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Express Pd: GALORE
/
Express Pd Galore - The Amiga PD & Shareware CD (1994)(Express Pd)[!][Amiga-CD32-CDTV].iso
/
amicus
/
amicus_#5
/
printer
/
dospecial.c
next >
Wrap
C/C++ Source or Header
|
1978-01-03
|
3KB
|
121 lines
/* dospecial.c AmigaLink 1/25/86 */
/* epson X80 special commands */
/****** printer.device/printers/Epson_functions **************************
*
* special functions implemented:
*
* aRIN, aSUS0, aSUS1, aSUS2, aSUS3, aSUS4,
* aPLU, aPLD, aVERP0, aVERP1, aSLRM, aIND, aCAM
*
************************************************************************/
#include "exec/types.h"
#include "devices/printer.h"
#include "devices/prtbase.h"
extern struct PrinterData *PD;
DoSpecial(command,outputBuffer,vline,currentVMI,crlfFlag,Parms)
char outputBuffer[];
UWORD *command;
BYTE *vline;
BYTE *currentVMI;
BYTE *crlfFlag;
UBYTE Parms[];
{
int x=0;
int y=0;
static char initMarg[]="\033lL\033Qq\033Q\120\033Q\210\033Q\240";
static char
initThisPrinter[]="\033x\001\0332\022\0335\033P\033-\376\033F\n\033W";
if(*command==aRIN) {
while(x<18){
outputBuffer[x]=initThisPrinter[x];
x++;
}
outputBuffer[x++]='\000';
outputBuffer[12]='\000';
if((PD->pd_Preferences.PrintQuality)==DRAFT)outputBuffer[2]='\000';
*currentVMI=36; /* assume 1/6 line spacing */
if((PD->pd_Preferences.PrintSpacing)==EIGHT_LPI) { /* wrong again */
outputBuffer[4]='0';
*currentVMI=27;
}
if ((PD->pd_Preferences.PrintPitch) != PICA)outputBuffer[x++]='\033';
if((PD->pd_Preferences.PrintPitch)==ELITE)outputBuffer[x++]='M';
else if((PD->pd_Preferences.PrintPitch)==FINE)
outputBuffer[x++]='\017';
Parms[0]=(PD->pd_Preferences.PrintLeftMargin);
Parms[1]=(PD->pd_Preferences.PrintRightMargin);
*command=aSLRM;
}
if(*command==aSLRM) {
initMarg[2]=Parms[0];
initMarg[5]=Parms[1]+1;
while(y<6)outputBuffer[x++]=initMarg[y++];
return(x);
}
if(*command==aCAM) {
initMarg[2]=1;
initMarg[5]=80;
while(y<15)outputBuffer[x++]=initMarg[y++];
return(x);
}
if(*command==aPLU) {
if((*vline)==0){
(*vline)=1;
*command=aSUS2;
return(0);
}
if((*vline)<0){
(*vline)=0;
*command=aSUS3;
return(0);
}
return(-1);
}
if(*command==aPLD) {
if((*vline)==0){
(*vline)=(-1);
*command=aSUS4;
return(0);
}
if((*vline)>0){
(*vline)=0;
*command=aSUS1;
return(0);
}
return(-1);
}
if(*command==aSUS0) *vline=0;
if(*command==aSUS1) *vline=0;
if(*command==aSUS2) *vline=1;
if(*command==aSUS3) *vline=0;
if(*command==aSUS4) *vline=(-1);
if(*command==aVERP0) *currentVMI=27;
if(*command==aVERP1) *currentVMI=36;
if(*command==aIND) {
outputBuffer[x++]='\033';
outputBuffer[x++]='J';
outputBuffer[x++]= *currentVMI;
return(x);
}
return(0);
}